
#include "Hit.h"
#include "Material.h"

Vec3f Hit::getAmbientColor()const
{
	if (m_isTexture){
		Vec3f temp;
		Vec3f::AddMul(temp,m_textureColor,material->getAmbientColor());
		return temp;
	}
	return material->getAmbientColor();
}

Vec3f Hit::Shade(const Ray &ray,const Vec3f &dirToLight,const Vec3f &lightColor)const
{
	Vec3f color = material->Shade(ray,*this,dirToLight,lightColor);
	if (m_isTexture){
		Vec3f temp;
		Vec3f::AddMul(temp,m_textureColor,color);
		return temp;
	}
	return color;
}